package com.example.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    EditText mUsername;
    EditText mPassword;
    Button mLogin;
    Button mCancel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initData();
    }

    private void initData() {
        mLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String Username = mUsername.getText().toString();
                String Password = mPassword.getText().toString();
                if (Username.equals("") && Password.equals("")){
                    Intent intent = new Intent(MainActivity.this,TeamsActivity.class);
                    startActivity(intent);
                }else {
                    Toast.makeText(MainActivity.this, "ndjb", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }

    private void initView() {
        mUsername = findViewById(R.id.Et_Username);
        mPassword = findViewById(R.id.Et_Password);
        mLogin = findViewById(R.id.btn_Login);
        mCancel = findViewById(R.id.btn_Cancel);
    }
}
